Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Desktop freeware to SHRINK (aka optimize) PDFs

31 views
Skip to first unread message

Arlen Holder

unread,
Nov 13, 2019, 7:09:20 PM11/13/19
to
Do you know of good desktop freeware to optimize (aka shrink PDF size?

I noticed this old listing accidentally omits pdf shrinking/optimizing:
o Please improve this listing of available freeware PDF functionality
<https://groups.google.com/d/msg/alt.comp.freeware/iB5aOor0-Kw/hzoJDDjADQAJ>

In an mobile OS thread today, someone asked for shrink/optimize methods
where I pointed that user to our threads on freeware editing & removing
permissions of PDFs.
o PDF Shrinker, by John McWilliams
<https://groups.google.com/d/msg/misc.phone.mobile.iphone/9dPChJVDakk/gnjZ1hWTAwAJ>

It occurred to me while I was writing up a purposefully helpful response to
that query that I always optimize PDFs (aka shrink PDFs) using the Adobe
Writer (usually version 6 or 7) specific pulldown menu for shrinking PDFs,
which allows us to optimize for any desired version of PDF.

But that's payware.
Since I have the writer, I have never looked for PDF optimizer freeware.

Do you know of good desktop freeware to shrink (aka optimize) PDF size?
--
Usenet is where adults can ask other adults for relevant on-topic advice.

Arlen Holder

unread,
Nov 13, 2019, 7:29:56 PM11/13/19
to
On Thu, 14 Nov 2019 00:09:19 -0000 (UTC), Arlen Holder wrote:

> Do you know of good desktop freeware to shrink (aka optimize) PDF size?

Do you know of good desktop freeware to shrink (aka optimize) PDF size?

I should clarify that a search reveals a ton of "potential" solutions,
just as a search for 'best text editor' would - but - those in the
know would pick "vi" or "notepadd++" right off the bat.

Likewise here with searching for "free pdf shrinker optimizer"
where the results are so cluttered with online-converter and
free-to-download garbage that it's best to ask this group for what
THEY use (since testing all the potential solutions, most of which
will likely be scams, is infeasible).

Hence, if you ALREADY use a free PDF shrinker - that's what I ask for.

Also, it's interesting that Irfanview, with plugins, may be our best
bet if nothing else comes out of this, but Irfanview won't work for
other platforms.

PDF Toolkit may be the best, if platforms are a requirement.

If you're gonna say 'run a search', I'll do that for you just so
you know what garbage pops up (amid the jewels, I'm sure).

o Online PDF shrinkers/optimizers:
<http://pdfill.com/document_optimizer.html>
<https://pdfresizer.com/optimize>
<https://tools.pdf24.org/en/compress-pdf>
<https://pdfresizer.com/resize>
<https://www.pdf2go.com/compress-pdf>
<https://www.cleverpdf.com/compress-pdf>
<https://www.sodapdf.com/compress-pdf/>

o PDF Toolkit - PDF Optimizer - PDF downsampler
<https://www.foxitsoftware.com/blog/pdf-toolkit-pdf-optimizer/>

o How to Optimize PDF Files with Free PDF Optimizer Tools
<https://pdf.wondershare.com/top-pdf-software/free-pdf-optimizer.html>

o How to Compress PDF in Adobe Acrobat Alternative
<https://pdf.iskysoft.com/edit-pdf/compress-pdf-in-adobe-acrobat.html>

o 8 Best PDF Compressor for Mac and Windows
<https://mashtips.com/pdf-compressor-mac-windows/>

o 3 Free Offline Bulk PDF Compressor ¡V Optimize And Shrink Large Files
<https://www.geckoandfly.com/24313/batch-bulk-pdf-compressor/>

o 8 Best Free Software To Compress PDF
<https://listoffreeware.com/best-free-software-to-compress-pdf/>

o Top 10 PDF Compressor to Reduce your PDF File Size for Free
<https://pdf.iskysoft.com/edit-pdf/top-free-pdf-compressor.html>

o 5 Easy Ways to Reduce PDF size
<https://www.freemake.com/blog/best-software-to-reduce-pdf-file-size/>

o PDF Compressors (said to be free - but they may be shills)
<https://www.thinstallsoft.com/pdf-compressor-portable/>
<https://www.pdfcompressor.net/>
<http://www.tucows.com/preview/1595741/Reduce-PDF-Size>

o Compress PDF Files With NXPowerLite
<https://www.neuxpower.com/compress-pdf/>

o Smallpdf
<https://smallpdf.com/>

Do you know of good desktop freeware to shrink (aka optimize) PDF size?
(best if it works on all platforms, or at least, one for each.)

Arlen Holder

unread,
Nov 13, 2019, 8:29:35 PM11/13/19
to
On Thu, 14 Nov 2019 00:29:55 -0000 (UTC), Arlen Holder wrote:

> I should clarify that a search reveals a ton of "potential" solutions,
> just as a search for 'best text editor' would - but - those in the
> know would pick "vi" or "notepadd++" right off the bat.

To get good working solutions that EVERYONE can test using their EXISTING
favorite solutions on their particular platform, I provide testcases below.

I ran a quick test of an arbitrary PDF book using the Adobe Acrobat 6
payware and Irvanview freeware on Windows (with the standard PDF-saving
plugins).
(I'm not yet sure what linux software to use so I'll test 1st on Windows.)

1. Original PDF Size = 8,556KB
o Advanced Vehicle Technology.pdf
LONGURL:
<http://www.parskhodro.ir/cache/fck_files/file/%D9%85%D9%82%D8%A7%D9%84%D8%A7%D8%AA%20%D8%B9%D9%84%D9%85%DB%8C/Advanced%20Vehicle%20Technology.pdf>
TINYURL:
<https://tinyurl.com/advanced-vehicle-technology>
2. Adobe Acrobat Size = 8,475KB (kind of disappointing)
3. Irfanview Size = 8,556KB (very disappointing)

Since that shrinking was disappointing, let's try this book:
A. Original PDF Size = 2,367KB
o Designing Analog Chips, by Hans Camenzind
<http://designinganalogchips.com/_count/designinganalogchips.pdf>
B. Adobe Acrobat Size = 2,278KB (also kind of disappointing)
C. Irfanview Size = 2,367KB (very disappointing)

Perhaps these books are _already_ highly optimized, where we likely should
start with a better testcase that is overly large for what it is.

Maybe these books that I happen to have on my system?
o Introduction to Programming using Python, by Y Daniel Liang
<https://doc.lagout.org/programmation/python/Introduction%20to%20Programming%20using%20Python%20%5BLiang%202012-01-12%5D.pdf>

o Building Blocks for Theoretical Computer Science, by Margaret M. Fleck
<http://mfleck.cs.illinois.edu/building-blocks/version-1.3/whole-book.pdf>

o Free to Choose, by Milton Friedman
<http://www.proglocode.unam.mx/sites/proglocode.unam.mx/files/docencia/Milton%20y%20Rose%20Friedman%20-%20Free%20to%20Choose.pdf>
etc.

--
Since this is a Usenet potluck, the PDFs should also be relevant somehow.

Arlen Holder

unread,
Nov 16, 2019, 11:09:13 AM11/16/19
to
Here are some suggestions from my log files, where I suggest ImageMagick
first, and GhostScript second.

LOG FILES:
Usually when Adobe Acrobat fails to get a good size, ImageMagick wins:
o convert -density 200x200 -quality 60 -compress jpeg big.pdf small.pdf
o convert -density 200x200 -quality 60 -compress jpeg -resize 50% big.pdf
small.pdf
o convert -compress Zip -density 150x150 big.pdf small.pdf
o <http://www.imagemagick.org/script/command-line-options.php#compress>

If not, GhostScript works reasonably well on a lot of the PDFs.
o gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook
-dNOPAUSE -dQUIET -dBATCH -sOutputFile=small.pdf big.pdf
o gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen
-dNOPAUSE -dBATCH -dQUIET -sOutputFile=small.pdf big.pdf
o gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dPDFSETTINGS=/printer
-dNOPAUSE -dQUIET -dBATCH -sOutputFile=small.pdf big.pdf
o gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dPDFSETTINGS=/ebook
-dNOPAUSE -dQUIET -dBATCH -sOutputFile=small.pdf big.pdf
o gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4
-dDownsampleColorImages=true -dColorImageResolution=150 -dNOPAUSE -dBATCH
-sOutputFile=small.pdf big.pdf
#!/bin/sh
gs -q -dNOPAUSE -dBATCH -dSAFER \
-sDEVICE=pdfwrite \
-dCompatibilityLevel=1.3 \
-dPDFSETTINGS=/screen \
-dEmbedAllFonts=true \
-dSubsetFonts=true \
-dColorImageDownsampleType=/Bicubic \
-dColorImageResolution=72 \
-dGrayImageDownsampleType=/Bicubic \
-dGrayImageResolution=72 \
-dMonoImageDownsampleType=/Bicubic \
-dMonoImageResolution=72 \
-sOutputFile=out.pdf \
$1

But each PDF is different.

There are LOTs of solutions in my logs that I've done over the years.
o <https://github.com/pts/pdfsizeopt>
o pdfsizeopt big.pdf small.pdf
o pdftk big.pdf output small.pdf compress
o <https://mupdf.com/docs/manual-mutool-convert.html>
o <https://mupdf.com/docs/manual-mutool-create.html>
o <http://qpdf.sourceforge.net/>
o qpdf --linearize big.pdf small.pdf
o pdf2ps big.pdf huge.ps && ps2pdf huge.ps small.pdf
o ps2pdf -dPDFSETTINGS=/ebook big.pdf small.pdf
o ps2pdf -dPDFSETTINGS=/printer big.pdf small.pdf
o pdf2ps big.pdf huge.ps && ps2pdf -dPDFSETTINGS=/screen
-dDownsampleColorImages=true -dColorImageResolution=200
-dColorImageDownsampleType=/Bicubic huge.ps small.pdf
o ps2pdf -dDownsampleColorImages=true -dDownsampleMonoImages=true
-dDownsampleGrayImages=true -dColorImageResolution=300
-dGrayImageResolution=600 -dMonoImageResolution=1200
o <https://www.windows10download.com/4dots-free-pdf-compress/> <- stinks
o <https://github.com/gugli28/PdfCompressor>
o <http://www.nicepdf.com/products.html> shareware
o <https://www.timedicer.co.uk/programs/help/pdf-compress.sh.php>
o Open big.pdf in Libre Office; export as pdf; set "jpeg compression
quality" & "image resolution"
o etc.

occam

unread,
Nov 16, 2019, 11:43:12 AM11/16/19
to
On 14/11/2019 02:29, Arlen Holder wrote:
> 1. Original PDF Size = 8,556KB
> o Advanced Vehicle Technology.pdf
> LONGURL:
> <http://www.parskhodro.ir/cache/fck_files/file/%D9%85%D9%82%D8%A7%D9%84%D8%A7%D8%AA%20%D8%B9%D9%84%D9%85%DB%8C/Advanced%20Vehicle%20Technology.pdf>

Using the book above, and FileOptimizer:
https://nikkhokkho.sourceforge.io/static.php?page=FileOptimizer

Original size: 8760476
Final size: 8298233

(Byte sizes are those given by the shrinking s/w.)

P.S File Optimizer, which exists in portable form also (32-bit and x64
versions) not only optimizes pdfs but also images (jpgs, pngs..) and
other file formats. I only use it for pdf-shrinking.

Carlos E.R.

unread,
Nov 16, 2019, 1:20:07 PM11/16/19
to
Notice that optimizing images may mean reducing their quality, thus
saying that a PDF was optimized does not mean much if the compromises
taken are not listed.


--
Cheers, Carlos.

Carlos E.R.

unread,
Nov 16, 2019, 1:28:06 PM11/16/19
to
On 14/11/2019 01.09, Arlen Holder wrote:
> Do you know of good desktop freeware to optimize (aka shrink PDF size?

Optimize is not the same as shrink.

For example, this Linux tool - you posted to a linux group - is an
optimizer which sometimes makes the files 10 times bigger. The goal is
to "optimize" a file that does not work on some tools to work, or work
faster:


PS2PS(1) Ghostscript Tools PS2PS(1)

NAME
ps2ps, eps2eps - Ghostscript PostScript "dis-
tiller"

SYNOPSIS
ps2ps [ options ] input output.ps
eps2eps [ options ] input output.eps

DESCRIPTION
ps2ps uses gs(1) to convert PostScript(tm) or
PDF(tm) file "input" to simpler, normalized and
(usually) faster PostScript in "output.ps". The
output is level 2 DSC 3.0 conforming PostScript.

eps2eps performs the equivalent optimization,
creating Encapsulated PostScript (EPS) files. NB,
despite the name, the input need not be an EPS
file, PostScript or indeed PDF files are equally
acceptable.

Both accept any general Ghostscript command line
options, and options specific to the ps2write and
eps2write devices.


Yeah, I know you asked about pdf. So pdf2ps first.

As to your question, I optimize during creation, not later. If needed, I
gzip the file.

--
Cheers, Carlos.

occam

unread,
Nov 17, 2019, 2:55:17 AM11/17/19
to
I quote:
"FileOptimizer is an advanced file optimizer featuring a lossless (no
quality loss) file size reduction that supports: <a host of file types>"

The file types include images, pdf, etc. If you are worried about
'embedded' images in the pdf, you shoudn't.

Arlen _G_ Holder

unread,
Nov 17, 2019, 3:43:18 PM11/17/19
to
On Sat, 16 Nov 2019 17:43:10 +0100, occam wrote:

> Using the book above, and FileOptimizer:
> https://nikkhokkho.sourceforge.io/static.php?page=FileOptimizer

Thank you occam for the suggestion of the open source "FileOptimizer"
<https://sourceforge.net/projects/nikkhokkho/files/FileOptimizer/>

I usually attempt to find the canonical location for software, since all my
questions are designed to be useful now & in the future, which, if
sourceforge isn't the canonical location for FileOptimizer software, let us
know, as the work we do together will help everyone, now & in the future
because it's archived in the permanent Usenet record at:
<http://tinyurl.com/comp-text-pdf>
<http://tinyurl.com/alt-comp-freeware>
<http://tinyurl.com/alt-os-linux>
<http://alt.comp.os.windows-10.narkive.com>

FileOptimizerSetup.exe
"FileOptimizer compresses already compressed files further without
changing the file format, and being totally compatible. It keeps the
behavior of the file untouched, but with its size reduced thanks to several
recompression and optimization techniques."

The number of formats it purports to optimize is astounding!

"FileOptimizer is an advanced file optimizer featuring a lossless (no
quality loss) file size reduction that supports: .3G2, .3GG, .3GP, .7Z, .A,
.AAI, .AC, .ACC, .ADP, .AI, .AIR, .APK, .APNG, .APPX, .APR, .ART, .ART,
.AVI, .AVS, .BAR, .BMP, .BPG, .BPL, .BSZ, .CBT, .CBZ, .CDR, .CDT, .CHI,
.CHM, .CHQ, .CHS, .CHW, .CIN, .CMYK, .CMYKA, .CPL, .CSL, .CSS, .CUR, .DB,
.DB, .DCX, .DDS, .DEB, .DES, .DIB, .DLL, .DOC, .DOCM, .DOCX, .DOT, .DOTM,
.DOTX, .DPX, .DRV, .DWF, .DWFX, .EAR, .EASM, .EML, .EMLX, .EPDF, .EPDF,
.EPRT, .EPUB, .EXE, .FAX, .FAX, .FB2, .FDF, .FITS, .FLA, .FLAC, .FLV, .FPX,
.FPX, .FXG, .FXG, .GALLERY, .GALLERYCOLLECTION, .GALLERYITEM, .GIF, .GRAY,
.GRS, .GZ, .HDR, .HRZ, .HTM, .HTML, .ICB, .ICL, .ICO, .ICO, .INK, .INLINE,
.IPA, .IPK, .IPSW, .ITA, .ITS, .ITZ, .J2C, .J2K, .JAR, .JFI, .JFIF, .JIF,
.JNG, .JP2, .JPC, .JPE, .JPEG, .JPG, .JPS, .JPT, .JS, .JSON, .KML, .KMZ,
.KMZ, .KSF, .LIB, .LIT, .LUA, .LUAC, .LXF, .LZL, .LZMA, .M4A, .M4B, .M4P,
.M4R, .M4V, .MAX, .MBX, .MCE, .MDB, .MDT, .MDZ, .MHT, .MHT, .MHTML, .MHTML,
.MIC, .MIF, .MIFF, .MIX, .MIZ, .MK3D, .MKA, .MKS, .MKV, .MMIP, .MNG, .MONO,
.MOV, .MP3, .MP4, .MPC, .MPD, .MPEG, .MPG, .MPO, .MPP, .MPP, .MPR, .MPT,
.MSC, .MSG, .MSG, .MSI, .MSL, .MSP, .MST, .MSZ, .MTV, .MTW, .MVG, .MVZ,
.MZZ, .NAR, .NBK, .NOTEBOOK, .O, .OBJ, .OCX, .ODB, .ODF, .ODG, .ODP, .ODS,
.ODT, .OEX, .OGA, .OGG, .OGG, .OGV, .OGX, .OGX, .OLE, .OLE2, .ONE, .OPT,
.OSK, .OST, .OTB, .OXPS, .P7, .PALM, .PBM, .PCC, .PCD, .PCDS, .PCL, .PCLS,
.PCX, .PDB, .PDF, .PFM, .PFS, .PGM, .PIC, .PICON, .PICT, .PK3, .PNG, .PNM,
.PNS, .POTM, .POTX, .PPAM, .PPM, .PPS, .PPSM, .PPSX, .PPT, .PPTM, .PPTX,
.PSB, .PSD, .PTIF, .PTIF, .PTIFF, .PTIFF, .PUB, .PUB, .PUZ, .QT, .QWK,
.R2SKIN, .RA, .RAM, .RDB, .RFA, .RFG, .RFT, .RGB, .RGBA, .RLL, .RM,
.RMSKIN, .RMVB, .RTE, .RV, .RVT, .S3Z, .SCR, .SGI, .SGML, .SLDASM, .SLDDRW,
.SLDM, .SLDPRT, .SLDX, .SMIL, .SOU, .SPL, .SPO, .SQLITE, .SQLITE2,
.SQLITE3, .STZ, .SUN, .SVG, .SVGZ, .SWC, .SWF, .SYS, .TAR, .TGA, .TGZ,
.THM, .TIF, .TIFF, .UYVY, .VBX, .VCARD, .VCF, .VDA, .VDX, .VICAR, .VIFF,
.VLT, .VOB, .VSD, .VSS, .VST, .VST, .VSX, .VTX, .WAL, .WAR, .WAV, .WBA,
.WBMP, .WEBA, .WEBM, .WEBP, .WIZ, .WMA, .WMV, .WMZ, .WPS, .WSZ, .X, .XAP,
.XBM, .XHTML, .XHTML, .XL, .XLA, .XLAM, .XLC, .XLM, .XLS, .XLSM, .XLSX,
.XLTM, .XLTX, .XLW, .XML, .XML, .XMZ, .XNK, .XPI, .XPM, .XPS, .XSF, .XSL,
.XSLT, .XSN, .XWD, .YCBR, .YCBRA, .YUB, .Z01, .Z02, .Z03, .Z04, .Z05, .Z06,
.Z07, .Z08, .Z09, .Z10, .ZIP, .ZIPX, .ZX01, .ZX02, .ZX03, .ZX04, .ZX05,
.ZX05, .ZX06, .ZX07, .ZX08, .ZX09, .ZX10, STICKYNOTES.SNT, and THUMBS.DB
file formats among many others."

PS: The question of what is "optimization", has relevancy here.
--
Usenet works great when adults helpfully publicly share items of value.

Arlen _G_ Holder

unread,
Nov 17, 2019, 3:46:25 PM11/17/19
to
On Sun, 17 Nov 2019 08:55:15 +0100, occam wrote:

> "FileOptimizer is an advanced file optimizer featuring a lossless (no
> quality loss) file size reduction that supports: <a host of file types>"
>
> The file types include images, pdf, etc. If you are worried about
> 'embedded' images in the pdf, you shoudn't.

Carlos brought up a point that people (not me) distinguish between
o Optimize
o Shrink (reduce size)

OK. I admit ignorance.
I don't know the difference (since I treat them the same).
Since I assume my treating them the same is wrong, does everyone else
already agree what the distinction is between optimize & shrink?

If so, can someone hazard the definition that you all agree on?

p-0''0-h the cat (coder)

unread,
Nov 17, 2019, 4:44:57 PM11/17/19
to
Sure 'Optimize' is a lie. Lossy compression is never optimal. It sucks.
There is only very rarely a good reason to compress pdf's nowadays.
Optimize relies most heavily on extreme jpg compression which in 95%+ of
cases looks horrible. Why do it at all with the kind of bandwidth most
of us have available. Yet the visually illiterate still commit this act.
Don't do it. Don't die dumb. This isn't a practice to encourage. It's
horrid. Before you reply defending this practice thinky real hard. Lossy
compression is for dinosaurs and using the word optimize in this context
is the kind of act of verbal distortion you expect of expedient morally
corrupt two bit point of sales cowboys.

Sent from my iFurryUnderbelly.

--
p-0.0-h the cat

Internet Terrorist, Mass sock puppeteer, Agent provocateur, Gutter rat,
Devil incarnate, Linux user#666, BaStarD hacker, Resident evil, Monkey Boy,
Certifiable criminal, Spineless cowardly scum, textbook Psychopath,
the SCOURGE, l33t p00h d3 tr0ll, p00h == lam3r, p00h == tr0ll, troll infâme,
the OVERCAT [The BEARPAIR are dead, and we are its murderers], lowlife troll,
shyster [pending approval by STATE_TERROR], cripple, sociopath, kook,
smug prick, smartarse, arsehole, moron, idiot, imbecile, snittish scumbag,
liar, total ******* retard, shill, pooh-seur, scouringerer, jumped up chav,
punk ass dole whore troll, no nothing innumerate religious maniac,
lycanthropic schizotypal lesbian, the most complete ignoid, joker, and furball.

NewsGroups Numbrer One Terrorist

Honorary SHYSTER and FRAUD awarded for services to Haberdashery.
By Appointment to God Frank-Lin.

Signature integrity check
md5 Checksum: be0b2a8c486d83ce7db9a459b26c4896

I mark any message from »Q« the troll as stinky

nospam

unread,
Nov 17, 2019, 5:20:14 PM11/17/19
to
In article <qqsbj0$elk$1...@news.mixmin.net>, Arlen _G_ Holder
<_arlen....@halder.edu> wrote:

> OK. I admit ignorance.

progress.

ken

unread,
Nov 18, 2019, 3:21:18 AM11/18/19
to
In article <4fr5ag-...@Telcontar.valinor>, robin_...@es.invalid
says...

> For example, this Linux tool - you posted to a linux group - is an
> optimizer

No it isn't, Ghostscript makes *no* claim to making files smaller or
'optimizing' them (other than 'optimize for fast web view' in Adobe
terms, which actually makes files bigger).

There can be valid reasons for processing a PDF file to get a new PDF
file; these include colour conversion and production of specific types
of PDF such as PDF/A or PDF/X. Making the file smaller is not, and never
has been, a design goal.


The documentation in VectorDevices.htm tries hard (I wrote it) to make
it clear what process is being undertaken. Whatever the input
(PostScript, PDF, XPS, PCL, PXL, various image formats) Ghostscript
turns the input into a set of marking operations and sends them to the
device. The device then 'processes' those; either it renders to a bitmap
or in the case of the pdfwrite device, its turns those marking
operations into PDF content streams.

The device has no clue at all about what format or language the input
was in and, generally, the interpreter has no idea about what the device
is doing (there are ways it can ask certian things). Teh input and
output are independent of each other.


If you use the specific controls to reduce the quality of images
(DownsampleColorImages, DownsampleGrayImages, DownsampleMonoImages) then
yes, the quality is poorer, because that's what you asked for.

Now the pdfwrite device does have a few tricks for reducing the output
size; certain kinds of object are hashed, and the hash stored. If we
encounter another object of the same kind, with the same hash, we don't
emit a new copy, we just reference the one we already wrote. A sequence
of 4 lines can, under the right conditiona be emitted as a rectangle,
etc etc.

However a well-constructed input PDF file would do exactly the asme, so
in general Ghostscript, given a PDF file as an input, will produce an
output file which is broadly the same size. Cases where the output is
considerably smaller include such things as the creating application
embedding the original application file inside the PDF. In this case the
embedded file would be lost. This *is* a reason to be cautious, other
'metadata' can be omitted as well.

More generally, you will only get a significantly smaller file if you
either reduce the quality or the original input file was created sub-
optimally (for size).


> which sometimes makes the files 10 times bigger.

In general that will only happen if you use colour conversion, and
select s lossless compression filter. It is true that this *can* happen
if the input file uses JPEG2000, because patent issues mean we are still
reluctant to embed a JPEG2000 encoder in the open-source version.

I'd argue that it is rare that the *current* version of Ghostscript
would make an output file which is significatnly larger than the input.

If you have a JPEG image in the input and do not either colour convert
or downsample the image data, then it is embedded in the output
unchanged. Obviously if you want to (eg) change an RGB JPEG image to a
CMYK image, the image needs to be decompressed and the amount of image
data will, obviously, be 33% larger before recompression. So yes, the
output file might be larger, especially if you were to choose a lossless
compression scheme.


> PS2PS(1) Ghostscript Tools PS2PS(1)

This isn't 'Ghostscript' its 'Ghostscript Tools'. Notice the man page
points out that these 'use' Ghostscript.


> Yeah, I know you asked about pdf. So pdf2ps first.

OMG NO!

Do *not* convert a PDF file to PostScript just so you can send the
resulting file through Ghostscript to get a PDF file. If you do that you
will very negatively impact the quality, as well as making the output
PDF file larger.

First point; don't use the scripts, use Ghostscript directly.

Secondly, the names of these scripts are historical and no longer
reflect (if they ever did) the true functionality. Any of them will take
*either* PostScirpt or PDF as an input.

So you can use 'ps2pdf' and supply a PDF file as the input, it does not
have to be a PostScript file.

I'm being pedantic here because I often have to help people who have no
idea how Ghostscript works, don't (or can't) read the documentation and
when asked how they came up with a workflow or command line answer
'Google'.

So this is to make clear what purpose Ghostscript is actually intended
for, and that you don't want to do PDF->PS->PDF just do PDF->PDF, should
anyone come across this thread while Googling......


Ken

Bernhard Kleine

unread,
Nov 18, 2019, 12:26:57 PM11/18/19
to
I use the following ghostscript for windows:

Z:\"Program Files"\gs\gs9.50\bin\gswin64 -sDEVICE=pdfwrite
-dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dPrinted=false
-dPassThroughJPEGImages=false -dDownsampleColorImages=true
-dColorImageResolution=400 -dDownsampleGrayImages=true
-dGrayImageResolution=400 -dDownsampleMonoImages=true
-dMonoImageResolution=400 -dNOPAUSE -dBATCH
-sOutputFile=file_Compressed.pdf file.pdf

for the book with some 500+ images the original pdf has 1.6 GB, the
compressed on some 60 Mb.

Allodoxaphobia

unread,
Nov 18, 2019, 2:16:49 PM11/18/19
to
I can confirm that Bernhard's gs script works un-changed on Ubuntu 14.04.
It is great for compressing those User Manual PDFs for cameras and iToys
which I load on my tablet for reference when I travel.

Save it as a shell script:

gs -sDEVICE=pdfwrite \
-dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dPrinted=false \
-dPassThroughJPEGImages=false -dDownsampleColorImages=true \
-dColorImageResolution=400 -dDownsampleGrayImages=true \
-dGrayImageResolution=400 -dDownsampleMonoImages=true \
-dMonoImageResolution=400 -dNOPAUSE -dBATCH \
-sOutputFile=$1.shrunk.pdf $1

It cut one camera User Manual in half, and a second camera User Manual to 1/3.

Strangely, it TRIPLED the size of "Linux-101-Hacks.pdf"

Thanks, Bernhard!!
Jonesy
--
Marvin L Jones | Marvin | W3DHJ.net | linux
38.238N 104.547W | @ jonz.net | Jonesy | FreeBSD
* Killfiling google & XXXXbanter.com: jonz.net/ng.htm

ken

unread,
Nov 18, 2019, 2:28:15 PM11/18/19
to
In article <qquk8v$ofl$1...@tota-refugium.de>, bb...@gmx.net says...

> I use the following ghostscript for windows:
>
> Z:\"Program Files"\gs\gs9.50\bin\gswin64 -sDEVICE=pdfwrite
> -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dPrinted=false
> -dPassThroughJPEGImages=false -dDownsampleColorImages=true
> -dColorImageResolution=400 -dDownsampleGrayImages=true
> -dGrayImageResolution=400 -dDownsampleMonoImages=true
> -dMonoImageResolution=400 -dNOPAUSE -dBATCH
> -sOutputFile=file_Compressed.pdf file.pdf
>
> for the book with some 500+ images the original pdf has 1.6 GB, the
> compressed on some 60 Mb.


If you've set DonsampleImages for all colour dpeths then setting
PassThroughJPEGImages=false is redundant, because in order to downsample
the images the image data must be decompressed and altered, so it
*can't* be passed through untouched.

You should never need to touch PassThroughJPEGImages, its best to leave
it alone. It was originally intended so that people could disable it
when the feature was new, in case it caused problems.


Ken

Carlos E.R.

unread,
Nov 18, 2019, 2:36:06 PM11/18/19
to
Are you familiar with compilers? Like GCC. If you search for "optimize"
you'll see that you can optimize for size or for speed - mutually
exclusive. And then there are many other subtle variations of
"optimize", like do this but not that.

Well, it is the same thing, you have to define what is your personal
goal "optimizing" PDFs - and both are of interest depending on the case.

You may want to reduce size, but not touching images, or yes but up to a
limit. Just an example.

Or you may want to replace usage of fonts like "Times New Roman" to
plain "Times" - because this allow removal of the font definition from
the file and instead use the PDF viever definition of that font. I have
done this in text mostly PDFs which "optimized" from a few hundred
kilobytes to just a few kilobytes.

This particular optimization I would like to find a program in Linux to
do it, because I lost my method: Libre Office has removed support for
printer fonts, which allowed this trick.


--
Cheers, Carlos.

Carlos E.R.

unread,
Nov 18, 2019, 2:52:07 PM11/18/19
to
On 18/11/2019 09.21, ken wrote:
> In article <4fr5ag-...@Telcontar.valinor>, robin_...@es.invalid
> says...
>
>> For example, this Linux tool - you posted to a linux group - is an
>> optimizer
>
> No it isn't, Ghostscript makes *no* claim to making files smaller or
> 'optimizing' them (other than 'optimize for fast web view' in Adobe
> terms, which actually makes files bigger).

I was talking of "ps2ps".

>
> There can be valid reasons for processing a PDF file to get a new PDF
> file; these include colour conversion and production of specific types
> of PDF such as PDF/A or PDF/X. Making the file smaller is not, and never
> has been, a design goal.
>
>
> The documentation in VectorDevices.htm tries hard (I wrote it) to make
> it clear what process is being undertaken. Whatever the input
> (PostScript, PDF, XPS, PCL, PXL, various image formats) Ghostscript
> turns the input into a set of marking operations and sends them to the
> device. The device then 'processes' those; either it renders to a bitmap
> or in the case of the pdfwrite device, its turns those marking
> operations into PDF content streams.
>
> The device has no clue at all about what format or language the input
> was in and, generally, the interpreter has no idea about what the device
> is doing (there are ways it can ask certian things). Teh input and
> output are independent of each other.
>
>
> If you use the specific controls to reduce the quality of images
> (DownsampleColorImages, DownsampleGrayImages, DownsampleMonoImages) then
> yes, the quality is poorer, because that's what you asked for.

Not the case with ps2ps :-)

>
> Now the pdfwrite device does have a few tricks for reducing the output
> size; certain kinds of object are hashed, and the hash stored. If we
> encounter another object of the same kind, with the same hash, we don't
> emit a new copy, we just reference the one we already wrote. A sequence
> of 4 lines can, under the right conditiona be emitted as a rectangle,
> etc etc.
>
> However a well-constructed input PDF file would do exactly the asme, so
> in general Ghostscript, given a PDF file as an input, will produce an
> output file which is broadly the same size. Cases where the output is
> considerably smaller include such things as the creating application
> embedding the original application file inside the PDF. In this case the
> embedded file would be lost. This *is* a reason to be cautious, other
> 'metadata' can be omitted as well.
>
> More generally, you will only get a significantly smaller file if you
> either reduce the quality or the original input file was created sub-
> optimally (for size).

I understand ps2ps uses certain constructs that while rendering the same
"image" are larger and faster. In their words, "normalized" ps.

>
>
>> which sometimes makes the files 10 times bigger.
>
> In general that will only happen if you use colour conversion, and
> select s lossless compression filter. It is true that this *can* happen
> if the input file uses JPEG2000, because patent issues mean we are still
> reluctant to embed a JPEG2000 encoder in the open-source version.
>
> I'd argue that it is rare that the *current* version of Ghostscript
> would make an output file which is significatnly larger than the input.

Well, I would have to retest the files in which I first observed this a
decade ago :-D

>
> If you have a JPEG image in the input and do not either colour convert
> or downsample the image data, then it is embedded in the output
> unchanged. Obviously if you want to (eg) change an RGB JPEG image to a
> CMYK image, the image needs to be decompressed and the amount of image
> data will, obviously, be 33% larger before recompression. So yes, the
> output file might be larger, especially if you were to choose a lossless
> compression scheme.
>
>
>> PS2PS(1) Ghostscript Tools PS2PS(1)
>
> This isn't 'Ghostscript' its 'Ghostscript Tools'. Notice the man page
> points out that these 'use' Ghostscript.

I don't think I said the contrary?

>
>
>> Yeah, I know you asked about pdf. So pdf2ps first.
>
> OMG NO!
>
> Do *not* convert a PDF file to PostScript just so you can send the
> resulting file through Ghostscript to get a PDF file. If you do that you
> will very negatively impact the quality, as well as making the output
> PDF file larger.

I don't think the quality should be impacted :-?

I have done it occasionally and not noticed anything. Why? I don't
remember, it could have been done to extract a few pages. Size, yes, I
know it changes a lot.

I do things like extract odd/even pages for printing, and as my printer
understand ps but not pdf, my output format needs to be ps.


> First point; don't use the scripts, use Ghostscript directly.

For that, /I/ would have to know the exact concoction to mimic the
script while using Ghostscript directly, and I don't.


> Secondly, the names of these scripts are historical and no longer
> reflect (if they ever did) the true functionality. Any of them will take
> *either* PostScirpt or PDF as an input.

Ah, good to know they admit PDF as input.

>
> So you can use 'ps2pdf' and supply a PDF file as the input, it does not
> have to be a PostScript file.

Interesting!

>
> I'm being pedantic here because I often have to help people who have no
> idea how Ghostscript works, don't (or can't) read the documentation and
> when asked how they came up with a workflow or command line answer
> 'Google'.
>
> So this is to make clear what purpose Ghostscript is actually intended
> for, and that you don't want to do PDF->PS->PDF just do PDF->PDF, should
> anyone come across this thread while Googling......


--
Cheers, Carlos.

Paul

unread,
Nov 18, 2019, 7:52:34 PM11/18/19
to
With regard to PDF, the notion of "optimize" was defined by Adobe
long ago. It already has a definition and you guys should not
ruin it by conflating it with "shrink".

"Optimize" is with respect to byte-serving, as far as I can remember.
A typical usage of the English, here.

https://forums.asp.net/t/1027406.aspx?Byte+Serving+PDF+with+a+HTTP+handler

Re: Byte Serving PDF with a HTTP handler
Sep 19, 2006 08:01 PM

pdf files intended to be served in byte ranges should be linearized
(web optimized) for best performance when they are created.

Such a feature was in the Adobe product I bought before 2006.

Who knows, you might even find a reference to this topic
in the PDF spec.

Messing around with the file for some other purpose, the
word "shrink" at least does not detract from the original
definition of optimize.

Paul

Carlos E.R.

unread,
Nov 18, 2019, 10:08:06 PM11/18/19
to
On 19/11/2019 01.52, Paul wrote:
> Carlos E.R. wrote:
>> On 17/11/2019 21.46, Arlen _G_ Holder wrote:
>>> On Sun, 17 Nov 2019 08:55:15 +0100, occam wrote:

...

> With regard to PDF, the notion of "optimize" was defined by Adobe
> long ago. It already has a definition and you guys should not
> ruin it by conflating it with "shrink".

Ah, but I have a excuse :-D

This thread was posted to several groups, including Linux groups, thus
I'm entitled to claim I do not know that Adobe is or what they say :-P

>
> "Optimize" is with respect to byte-serving, as far as I can remember.
> A typical usage of the English, here.
>
> https://forums.asp.net/t/1027406.aspx?Byte+Serving+PDF+with+a+HTTP+handler
>
>    Re: Byte Serving PDF with a HTTP handler
>    Sep 19, 2006 08:01 PM
>
>    pdf files intended to be served in byte ranges should be linearized
>    (web optimized) for best performance when they are created.
>
> Such a feature was in the Adobe product I bought before 2006.
>
> Who knows, you might even find a reference to this topic
> in the PDF spec.

So you mean optimize for web serving? In what sense, what do they do?
Maybe means that when we start downloading a PDF it will display
complete, but in bad definition, and details will complete and polish as
it continues downloading? Hum, I don't think PDFs do this. DjVus do.

To be pedantic, it is not "optimize" but "web optimize". Ie, optimize
for some goal. We can use the word "optimize" for another goal :-P


> Messing around with the file for some other purpose, the
> word "shrink" at least does not detract from the original
> definition of optimize.
>
>    Paul


--
Cheers, Carlos.

M. L.

unread,
Nov 19, 2019, 2:06:57 AM11/19/19
to

> FileOptimizer:
> https://nikkhokkho.sourceforge.io/static.php?page=FileOptimizer

> P.S File Optimizer, which exists in portable form also (32-bit and x64
> versions) not only optimizes pdfs but also images (jpgs, pngs..) and
> other file formats. I only use it for pdf-shrinking.

Thanks for the recommendation. It's a keeper until I find something better.

1.) excellent compression ratio
2.) portability isn't intuitive (must install full exe->copy all Program
Files to a portable folder->uninstall)
3.) nag screens
4.) cannot change output folder (saves in same folder as original PDF)


M. L.

unread,
Nov 19, 2019, 2:15:28 AM11/19/19
to

>> P.S File Optimizer, which exists in portable form also (32-bit and x64
>> versions) not only optimizes pdfs but also images (jpgs, pngs..) and
>> other file formats. I only use it for pdf-shrinking.
>
> Notice that optimizing images may mean reducing their quality, thus
> saying that a PDF was optimized does not mean much if the compromises
> taken are not listed.

By default, the app doesn't perform lossy jpeg or png optimizations, and
doesn't downsample PDF dpi.


ken

unread,
Nov 19, 2019, 2:57:58 AM11/19/19
to
In article <f79bag-...@Telcontar.valinor>, robin_...@es.invalid
says...

> >> PS2PS(1) Ghostscript Tools PS2PS(1)
> >
> > This isn't 'Ghostscript' its 'Ghostscript Tools'. Notice the man page
> > points out that these 'use' Ghostscript.
>
> I don't think I said the contrary?

But you refer to ps2ps, and post the man page from 'Ghostscript tools
PS2PS'. Hence my points above. I believe (not unreasonably I feel ) that
the ps2ps you were referring to was the Ghostscript ps2ps.


> > Do *not* convert a PDF file to PostScript just so you can send the
> > resulting file through Ghostscript to get a PDF file. If you do that you
> > will very negatively impact the quality, as well as making the output
> > PDF file larger.
>
> I don't think the quality should be impacted :-?

You *cannot* represent PDF transparency in PostScript, the PostScript
graphics model does not contain any real transparency (overprint and
masks do not count IMO and certainly do not approach the complexity of
the PDF transparency model.

You cannot presere ToUnicode CMaps through such a conversion and much
other metadata (hyperlinks for example) can only be preserved by use of
pdfmakrs. Some PDF constructs cannot be fully represented by pdfmarks.


> > First point; don't use the scripts, use Ghostscript directly.
>
> For that, /I/ would have to know the exact concoction to mimic the
> script while using Ghostscript directly, and I don't.

There is documentation replete with examples, and besides, its trivial:

gs -sDEVICE=pdfwrite -o <output.pdf> <input>

Or

gs -sDEVICE=ps2write -o <output.ps> <input>

That is almost entirely what the scripts (in a bizarre and confusing
way) do.


Ken

Richard Kettlewell

unread,
Nov 19, 2019, 4:14:34 AM11/19/19
to
"Carlos E.R." <robin_...@es.invalid> writes:
> Are you familiar with compilers? Like GCC. If you search for
> "optimize" you'll see that you can optimize for size or for speed -
> mutually exclusive.

In the case of compilers, the two possibilities are not mutually
exclusive. Smaller is often faster.

--
https://www.greenend.org.uk/rjk/

Carlos E.R.

unread,
Nov 19, 2019, 8:16:07 AM11/19/19
to
On 19/11/2019 10.16, Richard Kettlewell wrote:
> "Carlos E.R." <robin_...@es.invalid> writes:
>> Are you familiar with compilers? Like GCC. If you search for
>> "optimize" you'll see that you can optimize for size or for speed -
>> mutually exclusive.
>
> In the case of compilers, the two possibilities are not mutually
> exclusive. Smaller is often faster.

No, is not completely true or not always. It is true for the load time
of the process from disk or swap, of course.

And optimizing for speed does faster than optimizing for size. Some of
the optimizations for speed are expanding loops, for instance.


--
Cheers, Carlos.

Carlos E.R.

unread,
Nov 19, 2019, 8:20:07 AM11/19/19
to
Notice that I said that the compromises taken have to be listed. If
there are no compromises, it has to be said. Just "optimize" (for size)
doesn't say much.

So in this case "the app doesn't perform lossy jpeg or png
optimizations, and doesn't downsample PDF dpi" has to be said together
with the app citation.

Not knowing the app, my guess is that the app can also do those
optimizations on request.

--
Cheers, Carlos.

Carlos E.R.

unread,
Nov 19, 2019, 8:32:08 AM11/19/19
to
On 19/11/2019 08.57, ken wrote:
> In article <f79bag-...@Telcontar.valinor>, robin_...@es.invalid
> says...
>
>>>> PS2PS(1) Ghostscript Tools PS2PS(1)
>>>
>>> This isn't 'Ghostscript' its 'Ghostscript Tools'. Notice the man page
>>> points out that these 'use' Ghostscript.
>>
>> I don't think I said the contrary?
>
> But you refer to ps2ps, and post the man page from 'Ghostscript tools
> PS2PS'. Hence my points above. I believe (not unreasonably I feel ) that
> the ps2ps you were referring to was the Ghostscript ps2ps.

But I said neither it was Ghostcript nor Ghostscript tools. I just
mentioned a "Linux tool" and pasted part of the man page I have. I did
"man ps2ps", not "man PS2PS". If there is an error in the man page
itself, the error is not mine, I did not change it.


>>> Do *not* convert a PDF file to PostScript just so you can send the
>>> resulting file through Ghostscript to get a PDF file. If you do that you
>>> will very negatively impact the quality, as well as making the output
>>> PDF file larger.
>>
>> I don't think the quality should be impacted :-?
>
> You *cannot* represent PDF transparency in PostScript, the PostScript
> graphics model does not contain any real transparency (overprint and
> masks do not count IMO and certainly do not approach the complexity of
> the PDF transparency model.
>
> You cannot presere ToUnicode CMaps through such a conversion and much
> other metadata (hyperlinks for example) can only be preserved by use of
> pdfmakrs. Some PDF constructs cannot be fully represented by pdfmarks.

Ah, links. Ok, I forgot to mention I do those things only for printing.



>>> First point; don't use the scripts, use Ghostscript directly.
>>
>> For that, /I/ would have to know the exact concoction to mimic the
>> script while using Ghostscript directly, and I don't.
>
> There is documentation replete with examples, and besides, its trivial:
>
> gs -sDEVICE=pdfwrite -o <output.pdf> <input>
>
> Or
>
> gs -sDEVICE=ps2write -o <output.ps> <input>
>
> That is almost entirely what the scripts (in a bizarre and confusing
> way) do.

The fact that they are confusing confuses me to not know how to do it
calling gs directly ;-)

I would need a cheat list


--
Cheers, Carlos.

Richard Kettlewell

unread,
Nov 19, 2019, 11:54:11 AM11/19/19
to
"Carlos E.R." <robin_...@es.invalid> writes:
> On 19/11/2019 10.16, Richard Kettlewell wrote:
>> "Carlos E.R." <robin_...@es.invalid> writes:
>>> Are you familiar with compilers? Like GCC. If you search for
>>> "optimize" you'll see that you can optimize for size or for speed -
>>> mutually exclusive.
>>
>> In the case of compilers, the two possibilities are not mutually
>> exclusive. Smaller is often faster.
>
> No, is not completely true or not always. It is true for the load time
> of the process from disk or swap, of course.

What isn’t completely true? I think “smaller is often faster” really is
true, as a statement about compiler optimisations. It’s vague, but that
doesn’t make it false. A few things that are bigger and faster
(e.g. loop unrolling, alignment, a subset of inlining) do not contradict
the statement. They would contradict “smaller is always faster”, or
“smaller is almost always faster”, but nobody is claiming either.

“Size vs speed” being mutually exclusive is definitely wrong though.
Output from gcc -O1 will pretty reliably be both smaller and faster than
from gcc -O0, for example.

--
https://www.greenend.org.uk/rjk/

occam

unread,
Nov 19, 2019, 2:39:56 PM11/19/19
to
Re: (2) - agree, it's a relatively recent development, and a bit of a
pain-in-the-arse

Re (3) - I get no nag screen. Is thsi during installation or when you
are using the FileOptimizer?

M. L.

unread,
Nov 20, 2019, 7:04:02 AM11/20/19
to
I continuously encounter the following nag popup after clicking the OK
or No button to any Options setting, whether I change anything or not.

<quote>
Do you want to contribute FileOptimizer development by showing ads while
it is in use?

This will encourage its future maintenance and upgrades, being highly
appreciated.
</quote>


Dan Purgert

unread,
Nov 20, 2019, 7:18:13 AM11/20/19
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

M. L. wrote:
>
>>>>  FileOptimizer:
>>>> https://nikkhokkho.sourceforge.io/static.php?page=FileOptimizer
>>>
>>>> P.S File Optimizer, which exists in portable form also (32-bit and x64
>>>> versions) not only optimizes pdfs but also images (jpgs, pngs..) and
>>>> other file formats. I only use it for pdf-shrinking.
>>>
>>> Thanks for the recommendation. It's a keeper until I find something better.
>>>
>>> 1.) excellent compression ratio
>>> 2.) portability isn't intuitive (must install full exe->copy all Program
>>> Files to a portable folder->uninstall)
>>> 3.) nag screens
>>> 4.) cannot change output folder (saves in same folder as original PDF)
>>>
>>>
>>
>> Re: (2) - agree, it's a relatively recent development, and a bit of a
>> pain-in-the-arse
>>
>> Re (3) - I get no nag screen. Is thsi during installation or when you
>> are using the FileOptimizer?
>
> I continuously encounter the following nag popup after clicking the OK
> or No button to any Options setting, whether I change anything or not.

(nag snipped)

Definitely a reason to *not* use that software (TBH, it reminds me of
the "freemium" / "shareware" stuff from the 1990s)


-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEBcqaUD8uEzVNxUrujhHd8xJ5ooEFAl3VLwAACgkQjhHd8xJ5
ooHs+Qf/SnDrs4EyWUpQZAWVRpUBtS+C7h4lFhGvtvXi9MlckXLIqMjY/5CB8tyh
4mxZAf6qQDYA0WzD2PsOMUUd9AgKQVWHAcM3axntYsYZ5aPsvTULDUwRRhnMeOqj
/vYnrC0nYDD+a3dmzVfu6QQe0LI+ZZbF98gJYNUGv7IXIahJwSrUrfBlLc0t5erZ
liX5toYh/YMjKxMi6hRdvU4pQg/7m1/j4XsW1jUGcWwSUFkBLbkdu3hpBzLkGWSr
6kzq1+n7NE2cs5xCzDHA2cT2sXJGriEQwR/MKlPHRcsZ9+wqjbKRtwY5iyaseb1l
pwmbU7ulrMcsI270xHahaCKKe5g9Yg==
=0+CV
-----END PGP SIGNATURE-----

--
|_|O|_|
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: 05CA 9A50 3F2E 1335 4DC5 4AEE 8E11 DDF3 1279 A281

Carlos E.R.

unread,
Nov 20, 2019, 8:20:08 AM11/20/19
to
On 19/11/2019 17.55, Richard Kettlewell wrote:
> "Carlos E.R." <robin_...@es.invalid> writes:
>> On 19/11/2019 10.16, Richard Kettlewell wrote:
>>> "Carlos E.R." <robin_...@es.invalid> writes:
>>>> Are you familiar with compilers? Like GCC. If you search for
>>>> "optimize" you'll see that you can optimize for size or for speed -
>>>> mutually exclusive.
>>>
>>> In the case of compilers, the two possibilities are not mutually
>>> exclusive. Smaller is often faster.
>>
>> No, is not completely true or not always. It is true for the load time
>> of the process from disk or swap, of course.
>
> What isn’t completely true? I think “smaller is often faster” really is
> true, as a statement about compiler optimisations. It’s vague, but that
> doesn’t make it false. A few things that are bigger and faster
> (e.g. loop unrolling, alignment, a subset of inlining) do not contradict
> the statement. They would contradict “smaller is always faster”, or
> “smaller is almost always faster”, but nobody is claiming either.

Translation issue :-)

>
> “Size vs speed” being mutually exclusive is definitely wrong though.
> Output from gcc -O1 will pretty reliably be both smaller and faster than
> from gcc -O0, for example.

You can not activate both size and speed options, I think.


--
Cheers, Carlos.

occam

unread,
Nov 20, 2019, 8:30:42 AM11/20/19
to
On 20/11/2019 13:18, Dan Purgert wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> M. L. wrote:
>>
>>>>>  FileOptimizer:
>>>>> https://nikkhokkho.sourceforge.io/static.php?page=FileOptimizer
>>>>
>>>>> P.S File Optimizer, which exists in portable form also (32-bit and x64
>>>>> versions) not only optimizes pdfs but also images (jpgs, pngs..) and
>>>>> other file formats. I only use it for pdf-shrinking.
>>>>
>>>> Thanks for the recommendation. It's a keeper until I find something better.
>>>>
>>>> 1.) excellent compression ratio
>>>> 2.) portability isn't intuitive (must install full exe->copy all Program
>>>> Files to a portable folder->uninstall)
>>>> 3.) nag screens
>>>> 4.) cannot change output folder (saves in same folder as original PDF)
>>>>
>>>>
>>>
>>> Re: (2) - agree, it's a relatively recent development, and a bit of a
>>> pain-in-the-arse
>>>
>>> Re (3) - I get no nag screen. Is thsi during installation or when you
>>> are using the FileOptimizer?
>>
>> I continuously encounter the following nag popup after clicking the OK
>> or No button to any Options setting, whether I change anything or not.
>
> (nag snipped)
>
> Definitely a reason to *not* use that software (TBH, it reminds me of
> the "freemium" / "shareware" stuff from the 1990s)
>

Hmm. I wonder if the reason I don't get nags is because of some
ad-inhibiting add-on, or maybe the fact that I did (in some recent past)
contribute some money to his cause? I suspect it is the former - I do
NOT recall receiving any special codes to deactivate any ads.

M. L.

unread,
Nov 20, 2019, 8:47:22 AM11/20/19
to

> Hmm. I wonder if the reason I don't get nags is because of some
> ad-inhibiting add-on, [snip] I do
> NOT recall receiving any special codes to deactivate any ads.

I also have ad-blocks and HOSTS enabled so I followed your cue and
instead of clicking on "No" to disallow displaying ads, I clicked "Yes"
to allow them.

Now the nagging is gone, and I don't see any ads either. Thanks.

Carlos E.R.

unread,
Nov 20, 2019, 9:24:08 AM11/20/19
to
Don't you think that it is fair on him to allow adds? He deserves
getting money, if it is a good program. As long as they don't obstruct
the view or be intrusive.

--
Cheers, Carlos.

M. L.

unread,
Nov 21, 2019, 4:41:10 AM11/21/19
to
I already stated that I gave the app permission to display ads.


Carlos E.R.

unread,
Nov 21, 2019, 7:00:07 AM11/21/19
to
And then you banned the adds in the hosts file and with ad-blocks. This
kills his revenue.

--
Cheers, Carlos.

The Horny Goat

unread,
Nov 22, 2019, 10:20:28 PM11/22/19
to
On Tue, 19 Nov 2019 16:55:54 +0000, Richard Kettlewell
<inv...@invalid.invalid> wrote:

>"Carlos E.R." <robin_...@es.invalid> writes:
>> On 19/11/2019 10.16, Richard Kettlewell wrote:
>>> "Carlos E.R." <robin_...@es.invalid> writes:
>>>> Are you familiar with compilers? Like GCC. If you search for
>>>> "optimize" you'll see that you can optimize for size or for speed -
>>>> mutually exclusive.
>>>
I am looking for a freeware package that edits PDFs or combines them.
The only real complicated ability it needs to have is the ability to
resequence the pages in a PDF document - most of the ones I create are
assembled from multiple Word or Excel documents and I got DAMNED tired
of PDF Creator Pro after it stopped working after my last system
upgrade for "too many installs"

Hint: I only ever installed their software ONCE and all the so called
"installs" after that were system upgrades - adding more RAM, a new
hard drive stuff like that. When they froze me out and didn't respond
to my e-mails I determined hell would freeze over before they got an
additional nickel out of me as that's one helluva way to treat a 10
year paying customer who only ever used their software on one machine
and upgraded to a new paid version at least 3 times along the way.

Hint 2 (to the software developers) Treat paying customers like scum
and they WILL return the favor! I never pirated their $$$ware or did
anything they didn't like - just ran afoul of their checksum software
that wrongly thought I was pirating it all over town. wrong!

Paul

unread,
Nov 23, 2019, 1:52:17 AM11/23/19
to
mupdf mutool command line

http://al.howardknight.net/?STYPE=msgid&MSGI=%3Cqnbhi9%24fu8%241%40dont-email.me%3E

Not intended for large documents particularly, as you're
not going to enjoy editing "War and Peace" that way.
Good for four page brochures.

Paul

The Horny Goat

unread,
Nov 23, 2019, 2:03:09 PM11/23/19
to
On Sat, 23 Nov 2019 01:52:15 -0500, Paul <nos...@needed.invalid>
wrote:

>> I am looking for a freeware package that edits PDFs or combines them.
>> The only real complicated ability it needs to have is the ability to
>> resequence the pages in a PDF document - most of the ones I create are
>> assembled from multiple Word or Excel documents and I got DAMNED tired
>> of PDF Creator Pro after it stopped working after my last system
>> upgrade for "too many installs"

>mupdf mutool command line
>
>http://al.howardknight.net/?STYPE=msgid&MSGI=%3Cqnbhi9%24fu8%241%40dont-email.me%3E
>
>Not intended for large documents particularly, as you're
>not going to enjoy editing "War and Peace" that way.
>Good for four page brochures.

Thanks for the tip - most of what I do are in the 10-20 page range and
are compiled by submissions received from other board members in a
national level non-profit. I've managed to arm wrestle them into ONLY
giving me documents in .DOC/DOCX, .XLS/XLSX or PDF (this took awhile!)
but occasionally get late submissions which require re-sequencing the
final master document.

I will definitely check this one out. Thanks!

William Unruh

unread,
Nov 25, 2019, 8:53:54 AM11/25/19
to
Can you not open them in libreoffice, assemble them in the order you
want and then print out as pdf?

Arlen Holder

unread,
Nov 27, 2019, 7:42:31 AM11/27/19
to
On Fri, 22 Nov 2019 19:20:25 -0800, The Horny Goat wrote:

> I am looking for a freeware package that edits PDFs or combines them.
> The only real complicated ability it needs to have is the ability to
> resequence the pages in a PDF document

Doesn't the original post contain this reference for that functionality?
o Please improve this listing of available freeware PDF functionality
<https://groups.google.com/d/msg/alt.comp.freeware/iB5aOor0-Kw/hzoJDDjADQAJ>

If that reference needs to be updated for your needs, please advise.

Bernhard Kleine

unread,
Dec 14, 2019, 1:52:53 AM12/14/19
to
Am 18.11.2019 um 20:28 schrieb ken:
> In article <qquk8v$ofl$1...@tota-refugium.de>, bb...@gmx.net says...
>
>> I use the following ghostscript for windows:
>>
>> Z:\"Program Files"\gs\gs9.50\bin\gswin64 -sDEVICE=pdfwrite
>> -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dPrinted=false
>> -dPassThroughJPEGImages=false -dDownsampleColorImages=true
>> -dColorImageResolution=400 -dDownsampleGrayImages=true
>> -dGrayImageResolution=400 -dDownsampleMonoImages=true
>> -dMonoImageResolution=400 -dNOPAUSE -dBATCH
>> -sOutputFile=file_Compressed.pdf file.pdf
>>
>> for the book with some 500+ images the original pdf has 1.6 GB, the
>> compressed on some 60 Mb.
>
>
> If you've set DonsampleImages for all colour dpeths then setting
> PassThroughJPEGImages=false is redundant, because in order to downsample
> the images the image data must be decompressed and altered, so it
> *can't* be passed through untouched.
>
> You should never need to touch PassThroughJPEGImages, its best to leave
> it alone. It was originally intended so that people could disable it
> when the feature was new, in case it caused problems.
>
>
> Ken
>

After one recent Ghostscript update my PDFs did not compress as before
and I ask the GS people. Obviously this PassThroughJPEGImages=false is
now necessary. The reason(s) for this I have not inquired and it is
probably much to complicated for my mind.

Regards Bernhard

ken

unread,
Dec 14, 2019, 4:08:42 AM12/14/19
to
In article <qt20s3$ue6$1...@tota-refugium.de>, bb...@gmx.net says...

> After one recent Ghostscript update my PDFs did not compress as before
> and I ask the GS people. Obviously this PassThroughJPEGImages=false is
> now necessary. The reason(s) for this I have not inquired and it is
> probably much to complicated for my mind.

Its pretty simple. JPEG works, in part, by throwing away detail, what is
called 'lossy' compression.

If you start with a JPEG file, decompress it, and then re-apply JPEG
compression it throws away more detail resulting in a smaller size.

Repeating this process over and over will result in very small files. Of
course, they will be a featureless blur but if that's what you want.....

Previously Ghostscript always decompressed JPEG images, and the default
recompression was JPEG, so you got another pass of compression which
reduced the quality. Users who cared about quality rather than file size
had to apply more complex controls in order to prevent this happening,
and still ended up with images which were larger than the originals.

So if you don't change the colour model, and don't need to downample the
images to a lower resolution, then the images remain untouched leading
to better quality output.

Instead of setting pass through false, you could instead change the
DownsampleImages parameters. Or just turn off the pass through which is
simpler, but you do need to understand the choices you are making; you
are deliberately choosing to outptu lower quality images.

Ken
0 new messages